// import 'package:gm_login_plugin/gm_login_plugin.dart';
// import 'package:gm_login_plugin/models/gm_response.dart';
// import 'package:riki/config/config.dart';
// import 'package:tencent_kit/tencent_kit.dart';
//
// ///作者：范玉辉
// ///创建时间：2021/7/27
//
// class LoginQQAuth {
//   static Tencent t = Tencent.instance;
//
//   static initQQSDK() async {
//     await t.registerApp(
//       appId: AppConfig.instance.tencentAppId,
//       universalLink: AppConfig.instance.tencentUniversalLink,
//     );
//     // 是否安装
//     await isInstalled();
//
//     t.loginResp().listen((TencentLoginResp? resp) {
//       TencentLoginResp? authResponse = resp;
//
//       Map<String, dynamic> response = {};
//       if (authResponse?.accessToken != null && authResponse!.accessToken!.isNotEmpty) {
//         response["code"] = "0";
//         response["accessToken"] = authResponse.accessToken;
//         response["expirationDate"] = authResponse.expiresIn;
//         response["openId"] = authResponse.openid;
//         GMAuthResponse responseModel = GMAuthResponse(isSuccessed: authResponse.accessToken?.isNotEmpty, response: response);
//         GMLoginPlugin.authResponse(responseModel);
//       } else {
//         int code = authResponse!.ret;
//         String? failReason = authResponse.msg;
//         GMAuthResponse responseModel = GMAuthResponse(isSuccessed: false, failCode: code, failReason: failReason, response: response);
//         GMLoginPlugin.authResponse(responseModel);
//       }
//     });
//   }
//
//   static Future<bool> isInstalled() async {
//     bool isInstall = await t.isQQInstalled();
//     GMLoginPlugin.setIsInstalled(isInstall, GMESurpportPlatform.qq);
//     return isInstall;
//   }
//
//   static Future sendQQAuth() async {
//     return await t.login(scope: [AppConfig.instance.gmTencentScope]);
//   }
// }
